package com.ltmap.manager.user.controller;

import java.util.HashMap;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.ltmap.dao.user.entity.User;
import com.ltmap.manager.user.service.UserService;

@Controller
public class UserController {
	
	@Autowired
	private UserService userService;
	
	
	/**
	 * @Title:       login
	 * @Description: 用户登陆Controller类  
	 * @param:       @return
	 * @return:      HashMap<String,Object>
	 * @author:      yasin
	 * @Date:        2016年12月16日 下午4:40:12    x
	 * @throws
	 */
	@RequestMapping(value="login",method ={RequestMethod.POST,RequestMethod.GET}, 
			headers = {"content-type=application/json","content-type=application/xml"},produces = "application/json; charset=utf-8")
	@ResponseBody
	public User AppUserLogin(@RequestBody User user){
		System.out.println(user.getPhone());
		User ansUser=userService.Login(user);
		return ansUser;
	}
}
